<?php
/**
 * Created by PhpStorm.
 * User: Mak
 * Date: 2015/12/27
 * Time: 22:52
 */
include 'config.php';
$username=$_POST['username'];
$sex=$_POST['sex'];
$message=$_POST['message'];
$imgurl=$_POST['imgurl'];

$insert="insert into think_data(username,sex,message,imgurl) values('$username','$sex','$message','$imgurl')";
if  (mysql_query($insert,$link))
{
    header("location: index.php");
}
else
{
    echo "<script> alert('提交失败');parent.location.href='index.php'; </script>";
}